package com.jbjr.tianchi.Parments;

import org.elasticsearch.common.unit.TimeValue;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @Author：zgh
 * @DATE: 2018/7/31 15:11
 * @version: 0.0.1
 * @Description:
 */
public class QueryEs {

    private final TimeValue timeout = new TimeValue(60, TimeUnit.SECONDS); // 查询的等待时间
    private String index;//索引名（库名）
    private String type;//类型（表明）
    private String[] includeFields;//定义返回字段
    private String[] excludeFields;//定义不需要返回字段
    private int from = 0;//设置from确定结果索引的选项以开始搜索。默认为0。
    private int size = 10;//设置size确定要返回的搜索命中数的选项。默认为10000。
    private List<Condition> conditions;//用于k/v 检索条件
    private List<SortParment> sortParments;//排序字段
    private List<IntervalParment> intervalParments;//区间过滤的字段
    private AggregationBuildersParment aggregationBuildersParment;//聚合参数


    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public List<Condition> getConditions() {
        return conditions;
    }

    public void setConditions(List<Condition> conditions) {
        this.conditions = conditions;
    }

    public TimeValue getTimeout() {
        return timeout;
    }

    public int getFrom() {
        return from;
    }

    public void setFrom(int from) {
        this.from = from;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public List<SortParment> getSortParments() {
        return sortParments;
    }

    public void setSortParments(List<SortParment> sortParments) {
        this.sortParments = sortParments;
    }

    public List<IntervalParment> getIntervalParments() {
        return intervalParments;
    }

    public void setIntervalParments(List<IntervalParment> intervalParments) {
        this.intervalParments = intervalParments;
    }

    public String[] getIncludeFields() {
        return includeFields;
    }

    public void setIncludeFields(String[] includeFields) {
        this.includeFields = includeFields;
    }

    public String[] getExcludeFields() {
        return excludeFields;
    }

    public void setExcludeFields(String[] excludeFields) {
        this.excludeFields = excludeFields;
    }

    public AggregationBuildersParment getAggregationBuildersParment() {
        return aggregationBuildersParment;
    }

    public void setAggregationBuildersParment(AggregationBuildersParment aggregationBuildersParment) {
        this.aggregationBuildersParment = aggregationBuildersParment;
    }
}
